﻿
using System;
namespace sharpxbot.Core.Security
{
    /// <summary>
    /// Represents usage counter for some recurring activity. Allows to determine whether activity exceeded
    /// allowed executions counter during predefined time period
    /// </summary>
    public interface IUsageCounter
    {
        /// <summary>
        /// Increases usage counter
        /// </summary>
        void Perform();

        /// <summary>
        /// Gets value indicating whether executions counter exceeded allowed executions count during predefined time limit
        /// </summary>
        bool ExceedesLimit { get; }

        /// <summary>
        /// Time limit
        /// </summary>
        TimeSpan TimeLimit { get; set; }

        /// <summary>
        /// Executions count limit
        /// </summary>
        int CounterLimit { get; set; }
    }
}
